{* FILTERS *}

{literal}
<script language="javascript">
	
	var scrollDivs=new Array();
	scrollDivs[0]="workload_div";
	scrollDivs[1]="helpdiv";
	scrollDivs[2]="messagediv";
	scrollDivs[3]="editelement";
	scrollDivs[4]="history_div";
	
	function addfilter(field,value) {
		var forma = document.getElementById("reload");
		forma[field].value=value;		
		forma.submit();
	}
	function goUpload() {
		var forma = document.getElementById("reload");
		forma.action.value="fileupload";		
		forma.submit();
	}
	function setOrder() {
		var forma = document.getElementById("reload");
		forma.op.value="order";
		forma.submit();
	}
	
	window.onload=carga;
</script>
{/literal}
<script language="javascript">

	function showHistory(e,id) {ldelim}
		xajax.$('history_div_content').innerHTML="{$lang.loading}";
		openDiv(e,'history_div');
		showprogress();
		xajax_loadHistory(id);
		return false;
	{rdelim}

	function showWorkload(e) {ldelim}
		xajax.$('workload_div_content').innerHTML="{$lang.loading}";
		openDiv(e,'workload_div');
		showprogress();
		xajax_workload('{$teamid}');
		return false;
	{rdelim}
	
	function updateRequest() {ldelim}
		//closeForm('editelement');
		xajax.$('edit_status_progress').innerHTML="{$lang.updating}";
		showprogress();
		xajax_updateFile(xajax.getFormValues("list_form"));
	{rdelim}

	function sendFileList(e) {ldelim}
		xajax.$('noticediv_element_content').innerHTML="{$lang.sending}";
		openDiv(e,'noticediv_element');
		showprogress();
		xajax_sendMeMyFiles();
		return false;
	{rdelim}
	
</script>

{include file="mp.tpl"}
{include file="help.tpl" helpid="listhelp"}

<center>
	<table class="usermenu">
		<tr>
			<td><img src="images/package.png" alt="upload" width="18" height="18">&nbsp;<span class="link" onclick="goUpload()" title="{$lang.uploadfile}">{$lang.uploadfile}</span></td>		
{if $CURRENT_USER->groupid neq 'COORD' and $CURRENT_USER->groupid neq 'ADMIN'}
			<td><img src="images/contact.png" alt="contact" width="18" height="18">&nbsp;<span class="link" onclick="openMessage(event,'','utc')" title="{$lang.contactcoord}">{$lang.contactcoord}</span></td>
{/if}
{if $CURRENT_USER->groupid eq 'COORD' or $CURRENT_USER->groupid eq 'ADMIN'}
			<td><img src="images/workload.png" alt="workload" width="18" height="18">&nbsp;<span class="link" onclick="showWorkload(event)" title="{$lang.workload}">{$lang.workload}</span></td>
{/if}
			<td><img src="images/maillist.gif" alt="message" width="18" height="18">&nbsp;<span class="link" onclick="sendFileList(event)" title="{$lang.sendmemyfilelist}">{$lang.sendmemyfilelist}</span></td>
		</tr>
	</table>
<center>

<br/><br/>
<h2><span class="link" onclick="processForm('reload')" title="{$lang.reload}">{$projectname}</span></h2>
{if $projectmessage neq ''} <span style="font-style: oblique">{$projectmessage}</span> {/if}
<center>
<table border="0" cellpadding="0" cellspacing="0">
<tr>
<td colspan="3">
<b>{$lang.filterby}</b>
</td>
<tr>
<tr>
<td>
{$lang.status}
</td>
<td>
{$lang.filepath}
</td>
<td>
{$lang.userid}
</td>
<tr>
<td VALIGN="top">
{if $statusid neq ""}
	<img src="images/{$statusid}.png" alt="" width="18" height="18">	
	<b>{$lang.$statusid}</b><br/>
	<span class="link" onclick="addfilter('fstatusid','')">{$lang.all}</span>	
{else}
	{foreach from=$statuslist item=strow}
		<img src="images/{$strow}.png" alt="" width="18" height="18">
		{eval var=$strow assign="stid"}
		<span class="link"  onclick="addfilter('fstatusid','{$strow}')">{$lang.$stid}</span><br/>
	{/foreach}
{/if}
</td>
<td VALIGN="top">
{if $path neq ""}
	<b>{$path}</b><br/>
	<span class="link" onclick="addfilter('fpath','')">{$lang.all}</span>
{else}
	{foreach from=$pathlist item=ptrow}
		<span class="link" onclick="addfilter('fpath','{$ptrow}')">{$ptrow}</span><br/>
	{/foreach}
{/if}
</td>
<td VALIGN="top">
{if $userid neq ""}
	<b>{$userid}</b><br/>
	<span class="link" onclick="addfilter('fuserid','')">{$lang.all}</span>
{else}
	{foreach from=$userlist item=urow}
		<span class="link" onclick="addfilter('fuserid','{$urow}')">{$urow}</span><br/>
	{/foreach}
{/if}
</td>
</tr>
</table>
</center>
<center>
<table align="center" width="100%" border="0" cellpadding="0" cellspacing="0">

	<thead>
		<tr>
			<th>&nbsp;</th>
			<th><img src="images/sort_{$order}.gif" alt="sort" width="9" height="5">&nbsp;&nbsp;<span class="link" onclick="setOrder()" title="{$lang.sort}">{$lang.filename}</span></th>
			<th>{$lang.filepath}</th>
			{* <th>{$lang.lastupdate}</th> *}
			<th>{$lang.assigned}</th>
			<th>{$lang.untranslated}</th>
			<th>{$lang.fuzzy}</th>
			<th>{$lang.comment}</th>
		</tr>
	</thead>

	{* TABLE BODY - DYNAMIC *}
	<tbody name="filelist" id="filelist">
		{include file="filelist.tpl"}
	</tbody>

	<tfoot>
		<tr>
			<th colspan="4">&nbsp;</th>
			<th style="text-align: center">{$totaluntranslated}</th>
			<th style="text-align: center">{$totalfuzzy}</th>
			<th>&nbsp;</th>
		</tr>
	</tfoot>
</table>
<center>

<div name="editelement" id="editelement" style="display: none;" class="floatingform">
{include file="close.tpl" element="editelement"}	
<form method="post" id="list_form">
	<input type="hidden" name="flowid" id="flowid" value="{$flowid}">
	{*
	<input type="hidden" name="action" id="action" value="list">
	<input type="hidden" name="fstatusid" id="fstatusid" value="{$statusid}">
	<input type="hidden" name="fpath" id="fpath" value="{$path}">	
	<input type="hidden" name="fuserid" id="fuserid" value="{$userid}">
	<input type="hidden" name="teamid" id="teamid" value="{$teamid}">
	*}
	<input type="hidden" name="fstamp" id="fstamp" value="">
	<input type="hidden" name="op" id="op" value="">	
	<input type="hidden" name="id" id="id" value="">
	<table border="0" cellpadding="0" cellspacing="0">
		<tr>
			<td>{$lang.filename}</td>
			<td><input type="text" name="filename" id="filename" readonly></td>
		</tr>
		<tr>
			<td>{$lang.status}</td>
			<td>
				<select name="newstatus" id="newstatus">
					{foreach from=$astatuslist item=strow}
						{eval var=$strow assign="stid"}
						<option value="{$strow}">{$lang.$stid}</option>
					{/foreach}
				</select>			
			</td>
		</tr>
		{if $CURRENT_USER->groupid eq COORD}
		<tr>
			<td>{$lang.assignto}</td>
			<td>
				<select name="assignto" id="assignto">
					{foreach from=$userlist item=urow}
						{eval var=$strow assign="stid"}
						<option value="{$urow}">{$urow}</option>
					{/foreach}
				</select>			
			</td>
		</tr>		
		{/if}
		<tr>
			<td>{$lang.comment}</td>
			<td><input type="text" name="comment" id="comment" maxlength="255" size="50">
			</td>
		</tr>
   	<tr>
   		<td>&nbsp;</td>
	 		<td align="right">
	 			{include file="button.tpl" name=$lang.ok action="updateRequest()"}	
	 		</td>
			   	
   	</tr>	
   </table>	
</form>
<div id="edit_status_progress" name="edit_status_progress">
</div>
</div>
<form method="post" id="reload">
	<input type="hidden" name="flowid" id="flowid" value="{$flowid}">
	<input type="hidden" name="teamid" id="teamid" value="{$teamid}">
	<input type="hidden" name="action" id="action" value="list">
	<input type="hidden" name="fstatusid" id="fstatusid" value="{$statusid}">
	<input type="hidden" name="forder" id="forder" value="{$order}">
	<input type="hidden" name="fpath" id="fpath" value="{$path}">	
	<input type="hidden" name="fuserid" id="fuserid" value="{$userid}">
	<input type="hidden" name="op" id="op" value="">
</form>


<div id="history_div" class="floatingform" style="display: none; ">
	{include file="close.tpl" element="history_div"}
	<center>
	<div id="history_div_content" name="history_div_content">
	</div>
	</center>
</div>

<div id="workload_div" class="floatingform" style="display: none; ">
	{include file="close.tpl" element="workload_div"}
	<center>
	<div id="workload_div_content" name="workload_div_content">
	</div>
	</center>
</div>